package com.achobeta.recruitment.common;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 马拉圈
 * Date: 2023-10-01
 * Time: 23:33
 */
public enum ResultCode {
    //定义状态码常量
    SUCCESS                             (0, "成功"),


    FAILED                              (1000, "操作失败"),
    FAILED_UNAUTHORIZED                 (1001, "未授权"),
    FAILED_PARAMS_VALIDATE              (1002, "参数校验失败"),
    FAILED_PARAMS_OPENID                (1003, "openid错误"),
    FAILED_CREATE                       (1004, "新增失败"),
    FAILED_NOT_EXISTS                   (1005, "资源不存在"),
    FAILED_SAVE_STUDENT_INFO            (1006, "学生信息更新失败"),
    FAILED_STUDENT_INFO_GRADE           (1007, "学生年级信息错误"),
    FAILED_STUDENT_INFO_GENDER          (1008, "学生性别信息错误"),
    FAILED_PAGE_CONFIG_UPDATE           (1009, "用户端配置修改失败"),
    FAILED_FEEDBACK_STATE_UPDATE        (1010, "反馈状态修改失败"),
    FAILED_MANAGE_REMARKS_UPDATE        (1011, "管理员标记信息修改失败"),
    FAILED_STUDENT_STATE_UPDATE         (1012, "学生状态修改失败"),
    FAILED_FILE_TYPE                    (1013, "文件类型只能为png、jpg、jpeg、gif"),
    FAILED_URL_NOT_EXIT                 (1014, "url失效"),


    FAILED_USER_NOT_EXISTS              (1101, "⽤⼾不存在"),
    FAILED_MANAGER_NOT_EXISTS           (1102, "管理员不存在"),
    FAILED_MANAGER_IS_EXISTS           (1103, "管理员已存在"),
    FAILED_MESSAGE_IS_EXISTS           (1104, "消息不存在"),
    FAILED_LOGIN                        (1105, "⽤⼾名或密码错误"),
    FAILED_TWO_PWD_NOT_SAME             (1106, "两次输⼊的密码不⼀致"),
    FAILED_NOT_CHECK_BOX                (1107, "参数个数不为1"),
    FAILED_MESSAGE_STATE_UPDATE         (1108, "消息状态修改失败"),
    FAILED_MANAGER_NOT_POWERS           (1109, "管理员权限不足"),

    FAILED_FORBIDDEN                    (1200, "禁⽌访问"),// 重定向专用

    FAILED_DATA_TOO_LONG                (1301, "数据过长"),
    FAILED_DATABASE_OPERATE             (1302, "数据库操作失败"),

    ERROR_SERVICES                      (2000, "服务器内部错误"),
    ERROR_IS_NULL                       (2001, "IS NULL.");


    int code;//状态码
    String message;//描述信息

    ResultCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public String toString() {
        return "[ " +
                "code = " + code +
                ", message = '" + message + '\'' +
                ']';
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
